{% extends "risk/risk_base.html" %}
{% block title %}审批放款{% endblock %}
{% block head %}
{{ super() }}
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap-table.min.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/select2.min.css') }}">
<style>
    img.pre {
        border-radius: 5px;
        width: 172px;
        height: 110px;
    }
    .form-control {
        width: 30%;
    }
    .saw-info-label {
        width: 100px;
    }
    .saw-pic-label {
        width: 100%;
    }
    .saw-info-title {
        background: #F2F2F2;
        padding-top: 7px;
        padding-bottom: 7px;
    }
    
    .pre {display: inline-block;width: 172px;height: 160px;margin: 0 20px 0 0;}
    .pre img {border-radius: 5px;width: 172px;height: 110px;}
    .pre div {color: #3D3D3D;font-size: 13px;width: 170px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
    .pre div > a {float: right;}
    a.pre-del:hover {
        cursor: pointer;
    }

    .saw-info-text {
        font-size: 18px;
        margin-left: 15px;
    }
    .saw-form-group {
        width: 150px;
    }
    .saw-text-center {
        text-align: center;
    }
    .saw-review-block {
        width: 200px;
    }
    #id-label-process {
        width: 100%; 
        background: #E8EFF0; 
        font-size: 20px; 
        padding-top: 10px; 
        padding-bottom: 10px; 
        margin-top: 5px; 
        margin-bottom: 5px;
    }


</style>
{% endblock %}
{% block page_content %}

<h1 class="page-header">{% if not finished %}审批放款{% else %}放款详情{% endif %}</h1>


<div class="form-group form-inline">
    <label class="saw-info-title saw-info-label">
        <center>申请人</center>
    </label>
    <span class="saw-info-text">{{ r.name }}</span><span>({{ r.person_type }})</span>
</div>
<div class="form-group form-inline">
    <label class="saw-info-title saw-info-label">
        <center>申请电话</center>
    </label>
    <span class="saw-info-text">{{ r.phone }}</span>
</div>
<div class="form-group form-inline">
    <label class="saw-info-title saw-info-label">
        <center>地区</center>
    </label>
    <span class="saw-info-text">{{ r.area }}</span>
</div>
<div class="form-group form-inline">
    <label class="saw-info-title saw-info-label">
        <center>申请备注</center>
    </label>
    <span class="saw-info-text">{{ r.mark }}</span>
</div>
<div class="form-group form-inline">
    <label class="saw-info-title saw-info-label">
        <center>类型</center>
    </label>
    <span class="saw-info-text">{{ r.pledge_type }}</span>
</div>
<div class="form-group form-inline">
    <label class="saw-info-title saw-info-label">
        <center>金额</center>
    </label>
    <span class="saw-info-text">{{ r.amount }}</span>
</div>
<div class="form-group form-inline">
    <label class="saw-info-title saw-info-label">
        <center>利息</center>
    </label>
    <span class="saw-info-text">{{ r.interest }}</span>
</div>
<div class="form-group form-inline">
    <label class="saw-info-title saw-info-label">
        <center>分期</center>
    </label>
    <span class="saw-info-text">{{ r.days }} 天</span>
</div>


<div>
    {% for item in sort_app %}
    {% set num, title = item %}
    <div class="form-group saw-upload-pic">
        <label class="saw-info-title saw-pic-label">{{ title }}</label>
        {% for rp in rps %}
        {% if rp.picture_type == num and rp.flow == 'app' %}
        <img src="{{rp.url}}" class="pre">
        {% endif %}
        {% endfor %}
    </div>
    {% endfor %}
</div>

<div>
    {% for item in sort_loan %}
    {% set num, title = item %}
    <div class="form-group saw-upload-pic">
        <label class="saw-info-title saw-pic-label">{{ title }}</label>
        {% for rp in rps %}
        {% if rp.picture_type == num and rp.flow == 'loan' %}
        <img src="{{rp.url}}" class="pre">
        {% endif %}
        {% endfor %}
    </div>
    {% endfor %}
</div>




<div>

<label id="id-label-process" style="">审核进度:</label>

<!-- <span id="progress">
    {% for rf in rfs %}
    <h4 class="text-justify">

        审核人： {{ rf.review_name }}
        审核时间： {{ rf.timestamp }}
    </h4>
    {% endfor %}
</span> -->
<div id="progress" class="">
    {% for rf in rfs %}
    <div class="saw-text-center saw-review-block col-md-3">
    
        <p>审核人： {{ rf.review_name }}</p>
        <p>审核时间： {{ rf.timestamp }}</p>
    √
    </div>

    {% endfor %}
</div>

<!-- <dl class="dl-horizontal" style="font-size: 16px;">
{% for rf in rfs %}
  <dt>审核人： </dt>
  <dd>{{ rf.review_name }}</dd>
    <dt>审核时间：  </dt>
  <dd>{{ rf.timestamp }}</dd>
    {% endfor %}

</dl> -->


{% if not finished %}
<div class="form-group form-inline saw-form-group" style="float: right;">
    <form action="/risk/loan/review/pass" method="post">
        <input name="flow_id" type="hidden" value="{{ r.flow_id }}">
        <input name="xfrs" value="{{ xfrs }}" type="hidden">
        <input name="id" value="{{ r.id }}" type="hidden">
        <button class="btn btn-primary btn-block">通过</button>
    </form>

    <form action="/risk/loan/review/reject" method="post">
        <input name="flow_id" type="hidden" value="{{ r.flow_id }}">
        <input name="xfrs" value="{{ xfrs }}" type="hidden">
        <input name="id" value="{{ r.id }}" type="hidden">
        <button class="btn btn-danger btn-block" style="margin-top: 10px;">拒绝</button>
    </form>
</div>
{% endif %}

{% endblock %}
{% block scripts  %}
{{ super() }}
<script>

</script>
<script>
nav = document.getElementById("nav_review");
nav.setAttribute("class", "active");
$("#Review").addClass('in');
$('#review-loan').css("background", "#E0EEE0");

</script>
{% endblock %}
